package com.kongjs.application.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;


@Getter
@Setter
@ToString
@TableName("comments")
@Entity
@Table(name = "comments")
public class Comments implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Id
    @TableId(value = "comment_id", type = IdType.ASSIGN_ID)
    private Long commentId;

    @TableField("comment_post_id")
    private Long commentPostId;

    @TableField("comment_author")
    private String commentAuthor;

    @TableField("comment_author_email")
    private String commentAuthorEmail;

    @TableField("comment_author_url")
    private String commentAuthorUrl;

    @TableField("comment_author_ip")
    private String commentAuthorIp;

    @TableField("comment_date")
    private LocalDateTime commentDate;

    @TableField("comment_date_gmt")
    private LocalDateTime commentDateGmt;

    @TableField("comment_content")
    private String commentContent;

    @TableField("comment_karma")
    private Integer commentKarma;

    @TableField("comment_approved")
    private String commentApproved;

    @TableField("comment_agent")
    private String commentAgent;

    @TableField("comment_type")
    private String commentType;

    @TableField("comment_parent")
    private Long commentParent;

    @TableField("comment_likes")
    private Long commentLikes;

    @TableField("comment_dislikes")
    private Long commentDislikes;

    @TableField("user_id")
    private Long userId;

    @TableField(exist = false)
    private List<Comments> children;
}
